package service.Impl;

import dao.mapper.ClerkMapper;
import org.apache.ibatis.session.SqlSession;
import service.IClerkService;
import utils.SqlSessionUtil;
import vo.Clerk;

public class IClerkServiceImpl implements IClerkService {
    SqlSession sqlSession = new SqlSessionUtil().sqlSession;
    ClerkMapper clerkMapper = sqlSession.getMapper(ClerkMapper.class);
    @Override
    public void addClerk(Clerk clerk) {
        clerkMapper.addClerk(clerk);
        sqlSession.commit();
    }

    @Override
    public boolean checkClerck(String id) {
        Clerk clerk = null;
        clerk = clerkMapper.findById(id);
        if(clerk == null){
        return false;
        }else {
            return true;
        }
    }
}
